<div class="page">
	<div class="page-header">
		<div class="pull-left">
			<i class="icon-awesome-hdd icon-large"></i>
			<span class="divider"></span>
			<div class="title">
				<h3><?php echo __('Equipamentos'); ?></h3>
				<small><?php echo __('Gerencie as informações dos equipamentos e adicione fotos'); ?></small>
			</div>
		</div>
		<div class="pull-right">
			<?php echo $this->Html->link('<i class="icon-awesome-plus icon-white"></i>'.__('Novo'), array('action' => 'add'), array('escape' => false, 'class' => 'btn btn-primary btn-square')); ?>
		</div>
	</div>
	<div class="page-content">
		<?php echo $this->Form->create('Filter', array('class' => 'well')); ?>
		<fieldset>
		<legend>Filtrar por</legend>
		<div class="row-fluid">
			<div class="control-group span4">
				<?php echo $this->Form->Label('categoria', 'Categoria', array('class' => 'control-label'));	?>
				<div class="controls">
					<?php echo $this->Form->input('categoria_id', array('options' => $categorias, 'empty' => 'Todos...', 'label' => false, 'div' => false, 'class' => 'span12'));	?>
				</div>
			</div>
			<div class="control-group span4">
				<?php echo $this->Form->Label('localizacao', 'Localização', array('class' => 'control-label'));	?>
				<div class="controls">
					<?php echo $this->Form->input('localizacao_id', array('options' => $localizacaos, 'empty' => 'Todos...', 'label' => false, 'div' => false, 'class' => 'span12'));	?>
				</div>
			</div>
			<div class="control-group span4">
				<?php echo $this->Form->Label('projeto', 'Projeto', array('class' => 'control-label'));	?>
				<div class="controls">
					<?php echo $this->Form->input('projeto_id', array('options' => $projetos, 'empty' => 'Todos...', 'label' => false, 'div' => false, 'class' => 'span12'));	?>
				</div>
			</div>
		</div>
		<div class="row-fluid">
			<div class="control-group span2">
				<?php echo $this->Form->Label('tombo', 'Nº Tombo', array('class' => 'control-label'));	?>
				<div class="controls">
					<?php echo $this->Form->input('tombo', array('label' => false, 'div' => false, 'class' => 'span12')); ?>
				</div>
			</div>
			<div class="control-group span2">
				<?php echo $this->Form->Label('numero_serie', 'Nº Série', array('class' => 'control-label'));	?>
				<div class="controls">
					<?php echo $this->Form->input('numero_serie', array('label' => false, 'div' => false, 'class' => 'span12')); ?>
				</div>
			</div>
			<div class="control-group span8">
				<?php echo $this->Form->Label('descricao', 'Descrição', array('class' => 'control-label'));	?>
				<div class="controls">
					<?php echo $this->Form->input('descricao', array('label' => false, 'div' => false, 'class' => 'span12', 'placeholder' => 'Digite a palavra-chave')); ?>
				</div>
			</div>
		</div>
		<div class="row-fluid">
			<div class="control-group">
				<?php echo $this->Form->button('<i class="icon-search icon-white"></i> Filtrar', array('type' => 'submit', 'div' => false, 'class' => 'btn btn-primary', 'escape' => false)); ?>
			</div>
		</div>
		</fieldset>
		<?php echo $this->Form->end(); ?>
	
		<table class="table table-bordered table-striped table-condensed">
		<thead>
		<tr>
			<th><?php echo $this->Paginator->sort('id', 'Código');?></th>
			<th><?php echo $this->Paginator->sort('descricao', 'Equipamento');?></th>
			<th><?php echo $this->Paginator->sort('Categoria.nome', 'Categoria');?></th>
			<th><?php echo $this->Paginator->sort('Localizacao.local', 'Localização');?></th>
			<th class="actions"><?php echo __('Ações');?></th>
		</tr>
		</thead>
		<tbody>
<?php
		foreach ($equipamentos as $equipamento): ?>
		<tr>
			<td><?php echo h($equipamento['Equipamento']['id']); ?>&nbsp;</td>
			<td><?php echo h($equipamento['Equipamento']['descricao']); ?>&nbsp;</td>
			<td><?php echo $this->Html->link($equipamento['Categoria']['nome'], array('controller' => 'categorias', 'action' => 'view', $equipamento['Categoria']['id'])); ?></td>
			<td><?php echo $this->Html->link($equipamento['Localizacao']['local'], array('controller' => 'localizacaos', 'action' => 'view', $equipamento['Localizacao']['id'])); ?></td>
			<td class="actions">
				<?php echo $this->Html->link('<i class="icon-eye-open icon-white"></i>', array('action' => 'view', $equipamento['Equipamento']['id']), array('escape' => false, 'class' => 'btn btn-primary btn-mini')); ?>
				<?php echo $this->Html->link('<i class="icon-pencil icon-white"></i>', array('action' => 'edit', $equipamento['Equipamento']['id']), array('escape' => false, 'class' => 'btn btn-primary btn-mini')); ?>
				<?php echo $this->Form->postLink('<i class="icon-trash icon-white"></i>', array('action' => 'delete', $equipamento['Equipamento']['id']), array('escape' => false, 'class' => 'btn btn-danger btn-mini'), __('Are you sure you want to delete # %s?', $equipamento['Equipamento']['id'])); ?>
			</td>
		</tr>
<?php endforeach; ?>
		</tbody>
		</table>
		
		<div class="pull-left">
			<?php echo $this->Paginator->counter(array('format' => __('Página {:page} de {:pages}, exibindo {:current} do total de {:count} registros'))); ?>
		</div>
		<div class="pagination pagination-right pagination-small text-right">
			<ul>
			<?php
				echo $this->Paginator->first(('<i class="icon-awesome-step-backward"></i>'), array('tag' => 'li', 'escape' => false));
				echo ($this->Paginator->hasPrev()) ? $this->Paginator->prev(('<i class="icon-awesome-backward"></i>'), array('tag' => 'li', 'escape' => false), null, array('class' => 'disabled', 'tag' => 'li', 'escape' => false, 'disabledTag' => 'a')) : '';
				echo $this->Paginator->numbers(array('separator' => '', 'tag' => 'li', 'currentClass' => 'active', 'currentTag' => 'a'));
				echo ($this->Paginator->hasNext()) ? $this->Paginator->next(('<i class="icon-awesome-forward"></i>'), array('tag' => 'li', 'escape' => false), null, array('class' => 'disabled', 'tag' => 'li', 'escape' => false, 'disabledTag' => 'a')) : '';
				echo $this->Paginator->last(('<i class="icon-awesome-step-forward"></i>'), array('tag' => 'li', 'escape' => false));
			?>
			</ul>
		</div>
		
	</div>
</div>